%h1 Random user passwords

-if @changed
  %p 
    %b Done!
    Here's a new password list. 
    Go back to
    = (link_to '[user list]', :action => 'index') + '.'
  %br/
  %table
    %tr
      %th Login
      %th Fullname
      %th Password
    -for u in @non_admin_users
      %tr
        %td= u.login
        %td= u.full_name
        %td
          %tt= u.password

-else
  -if @prefix!=''
    Current prefix:
    = @prefix
  -form_tag((url_for :action => 'random_all_passwords'), :method => 'get') do
    Change prefix
    =text_field_tag 'prefix'
    =submit_tag 'Change'

  This will change passwords of the following users.
  %ul
    -for u in @non_admin_users
      %li= u.login

  -form_tag((url_for :action => 'random_all_passwords'), :method => 'post') do
    =hidden_field_tag 'prefix', @prefix
    Are you sure?
    =submit_tag 'Go ahead'
